home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / SDLOCO14.ZIP / SD_DEVLP.TXT < prev    next >
Encoding:
Text File  |  1996-02-20  |  28.4 KB  |  748 lines

  1. -------------------------------------------------------------------------
  2. STARDOCK LOCO - Expansion module help for programmers - IGM's
  3. -------------------------------------------------------------------------
  4. You are welcome to write any code that you wish for Stardock Loco's
  5. expansion module features, as long as you give me credit, and you do not
  6. charge more than the cost of Stardock Loco - if you create a module
  7. that you wish to have them register.  I would like to have a look at it
  8. for approval, to make sure it stays within the game story, and doesn't
  9. trash a BBS's game files.
  10.  
  11. I do _not_ require any $$ from the proceeds of your module(s).  But if you
  12. want, send it over... <G>
  13.  
  14. The module must run from one of the expansion module areas in the game.
  15.  
  16. If you create a module, upload it to the support bbs, and I like it, I will
  17. send you a registration key for yourself or for your favorite BBS.  It
  18. doesn't necessarily have to be a great or large module by any means,
  19. just something creative and interesting. I'm pretty easy on the standards!
  20. Heck, this is all for fun anyway!
  21.  
  22. See the very bottom of this file for the support bbs numbers and how to get
  23. in touch with me.
  24.  
  25.  
  26. There are many IGM/expansion module areas:
  27.  
  28. * The <U> Upstairs and <D> Downstairs portions of Terran Pete's Slush Bar.
  29. * The Expansion Module area in the ShipYards. (30 slots)
  30. * The area on board a players ship: <G> Go for a cruise.
  31. * The Blackmarket.   <Enter> at the Main Menu.
  32. * Favrie Colony IGM slots.  (5 slots)
  33.  
  34. Necessary Information:
  35.  
  36. SDLoco was created using Brian Pirie's Opendoors program. If you are unfamiliar
  37. with this C library, I recommend that you download it from a BBS, and register
  38. it if you are going to use his library.  You may NOT attach a module that
  39. uses a library or program that is unregistered that interfaces with a modem,
  40. a BBS, and with Stardock Loco.  I accept no responsibility for your program
  41. and/or its uses!
  42.  
  43. <Mean Mode OFF>  :)
  44.  
  45. ----------------------------------------------------------------------------
  46. NEW ADDITION:  I have just added MODULE.C to the stardock zip file.  It
  47. contains the full source of the blkmkt1.exe to get you started easier on a mod.
  48. Just trying to make it easier on all of us...:)   You may want to read the
  49. code below, to get a little more insight, and see why I did what.....
  50.  
  51. Feel free to use module.c
  52. as a starting point for your module.  You can create a new black market that
  53. runs from that slot, but you must include the armor and weapon upgrades as
  54. part of your black market.  Note:  It is written using Brian Pirie's Opendoors
  55. serial comm door program, and cannot be compiled without the odoorh.lib.  But,
  56. you can change that easily if you have another program that you use.  See the
  57. MODULE.C for more information.
  58.  
  59. That slot is accessed by blkmkt?.exe, the question mark being the number or
  60. letter that you or I add to it.  The version included with sdloco is
  61. blkmkt1.exe.
  62.  
  63. --------------------------------------------------------------------------
  64. The Shipyards Expansion Slots
  65. --------------------------------------------------------------------------
  66. If you create a module, it would be a good idea to include a description
  67. for the Sysop to type into the sd_add.exe program.  Or you can write an
  68. easy install, and add it yourself.  See the structure of the module.lst
  69. file below.  (waaaay below..)  <--this only applies to the shipyards module
  70. area!
  71.  
  72.  
  73. -------------------------------------------------------------------------
  74. Terran Pete's   module slots
  75. -------------------------------------------------------------------------
  76. For the upstairs/downstairs area, no description is necessary.  All that you
  77. must do is begin the module name with:
  78.  
  79.             dn   To run from Downstairs
  80.             up   To run from Upstairs
  81.  
  82.         Example:   DNmymod.exe  <--it must end with .exe
  83.  
  84.         -And then dump it in the sdloco directory.
  85.  
  86. I use the C function _dos_findfirst to look for the module.  I am using the
  87. wildcard characters in the following way:
  88.             up*.exe
  89.             dn*.exe
  90.  
  91. Whatever you put between the up/dn and the .exe doesn't matter to me.  Do
  92. note that it looks for the first occurence of an "up" or a "dn", and will
  93. run that module.  If there are other modules in the directory, it will
  94. run the _first_ one it finds.  Make sure to notify the sysop of this, and
  95. tell them about removing another up/dn module, and possibly renaming it
  96. and adding it to the shipyard module area using the sd_add.exe.
  97.  
  98. -------------------------------------------------------------------------
  99. On board the ship   module slot    <G> Go for a cruise
  100. -------------------------------------------------------------------------
  101. For the on-board the ship area, no description is necessary.  All that you
  102. must do is begin the module name with:
  103.  
  104.                nd
  105.  
  106.         Example:   ndMymod.exe  <--it must end with .exe
  107.  
  108.         -And then dump it in the sdloco directory.
  109.  
  110.       This one is accessed from the <G> Go for a cruise part of the menu.
  111.       Feel free to create a new ending for the game if you wish!  Or take
  112.       'em for a ride to the center of the universe...I dinna care!  <G>
  113.  
  114.       Once again, I am using _dos_find_first!  See the Terran Pete's module
  115.       slot reference about this.
  116.  
  117. -------------------------------------------------------------------------
  118. Favrie Colony * New Developments Area
  119. -------------------------------------------------------------------------
  120. This area is for those of you that wish to create a planet based IGM.  There
  121. are 5 slots.  You will have to create a text file for the description of your
  122. module.  Just open an editor such as dos edit, and type in your description
  123. on the first line.  You have a 50 character line you can use. If you like, you
  124. can colorize your description with the following:
  125.         `red`         For bright colors:
  126.         `blue`          add bright:
  127.         `yellow`        example:  `bright red`
  128.         `cyan`
  129.         `green`
  130.  
  131. Here is an example description:
  132. `bright green`Into the Jungles of Favrie.    <-this will show up on the menu
  133.                            as a bright green item.
  134.  
  135. The ` is very important.
  136.  
  137. The modules and description files are as follows:
  138.             1fc*.exe
  139.             2fc*.exe
  140.             3fc*.exe           <-IGM names
  141.             4fc*.exe
  142.             5fc*.exe
  143.  
  144.             1fc*.dsc
  145.             2fc*.dsc
  146.             3fc*.dsc           <-Description files
  147.             4fc*.dsc
  148.             5fc*.dsc
  149.  
  150. -And then dump it in the sdloco directory.
  151. They will then run from the corresponding <1> <2> etc from the New Develop-
  152. ments menu on the Favrie Colony.
  153.  
  154. I use the C function _dos_findfirst to look for the module.  I am using the
  155. wildcard characters in the following way:
  156.             1fc*.dsc
  157.             1fc*.exe
  158.             3fc*.dsc, etc.
  159. Anything between the first three letters and the . are yours to add.  I don't
  160. look at them or worry about them.
  161.  
  162. If there are other modules with the same first 3 letters in the directory,
  163. it will run the _first_ one it finds.  Make sure to notify the sysop of this,
  164. and tell them about removing the other favrie module, and possibly renaming it
  165. and adding it to the shipyard module area using the sd_add.exe, or renaming
  166. yours to another module such as 5fcMymod.exe/.dsc.
  167.  
  168. ------------------------------------------------------------------------
  169. For all module areas:
  170. ------------------------------------------------------------------------
  171. Try to make the program install and un-install in a minute or less.  Save
  172. the Sysop all the hassle you can!  They're busy ya know!
  173.  
  174. NOTE WELL:
  175. * You must have exclusive file access if you access my player file!  See the
  176.   C version of the exclusive file access I have included.
  177.  
  178. ABOUT ME:
  179.   I am a new C programmer, as you experienced C people may notice in some
  180.   of the following code.  As a student at DeVry in Phoenix, Az, I decided
  181.   to really learn C the first day of the C class.  So, I wrote this sucker
  182.   in the following month.  I learned some C.  While the rest of the class
  183.   was doing printf, I was banging away at spawning other programs, and
  184.   doodling in memory allocation and serial comm.  They hate me...<JK>
  185.  
  186.   So, you may notice some weird stuff in the code that is in this text file.
  187.   I didn't change some of it because it worked, even though I found out later
  188.   that it wasn't the _best_ way.  But it werked at the time, and werks now.
  189.   Expect nicer cleaner stuff soon.....
  190.  
  191.   And, thanks for reading this, and playing Stardock Loco.  If you know
  192.   how to write stuff, please add on to the game.  It would be tremendously
  193.   cool to have a lot of nice add-ons that are full featured games that
  194.   work together!!  It could make it _the_ game to have!
  195.  
  196.  
  197. All of this is in C, if you don't know C, it shouldn't be too tough for
  198. you Pascalites, or other language types with a big book.
  199.  
  200. -------------------------------------------------------------------------
  201. Expansion Modules:   All areas, Terran Pete's/Shipyard Modules/On ship
  202. -------------------------------------------------------------------------
  203. I make the expansion modules separate entities from the game.  When they run
  204. the module, Stardock Loco is swapped to disk.  Your module then takes control
  205. of any modem interfacing.  When they return, Stardock then checks to see if
  206. the player's lifepoints are greater than 0.  If so, they continue the game.
  207. If not, they are sent back to the BBS.
  208.  
  209. The module is spawned similar to the spawnvpe function in C.  (Opendoors 5.0
  210. od_spawnvpe function).  What I pass to the module is the *path* to the door.sys
  211. or whatever type the door file is for the BBS.  That file contains all the
  212. information that is required for the door.  (od_control structure for Opendoors
  213. users).  Then I extract the player's real name from the door file.
  214.  
  215. Note:  If the game is run in local mode, I pass a switch of /L in the
  216. argv.  This causes the Sysop to log into the module....(gonna change that!)
  217.  
  218. When the player goes to the modules, I look up their real name, then when
  219. the match is found, run the module.  If it isn't found, that is a major error,
  220. and they return...  The favrie.exe Colony has it's own special player file.
  221. fav_pl.lst.  See the example waaaay at the bottom of this file.
  222.  
  223.  
  224. FILE AND CODE INFORMATION:   //Also see MODULE.C (Blackmarket)
  225.  
  226. *****************READ THIS, EVEN IF YOU'RE USING MODULE.C!!***************
  227.  
  228. ---------------------------------------------------------------------------
  229. The main player file as defined in C:       player.lst
  230. ---------------------------------------------------------------------------
  231. The player.lst is saved in text format.
  232.  
  233. I then convert the player to the correct integer and long values that
  234. I need in the game.  (Don't ask why..<G>)
  235.  
  236. //size definitions
  237. #define MAXNAME  30
  238. #define    MAXBBSNAME 36
  239. #define    MAXWEAPONNAME 20
  240. #define    MAXARMORNAME 20
  241. #define MAXSTANDARDLONG 10
  242. #define MAXSTANDARDINT 4
  243.  
  244. struct player
  245.     {
  246.     char on_now[MAXSTANDARDINT+1];  //If they are currently on-line = 1
  247.     char name[MAXNAME+1];           //Game name
  248.     char bbs_name[MAXBBSNAME+1];    //Real name
  249.     char living[MAXSTANDARDINT+1];  //if alive = 1, dead = 0
  250.     char killer[MAXNAME+1];         //Who killed them
  251.     char location[MAXSTANDARDINT+1];  //Where they are.  1=Terran Pete's
  252.                       //                 2=Pods
  253.     char lifepoints[MAXSTANDARDLONG+1];      //lifepoints
  254.     char lifepointsttl[MAXSTANDARDLONG+1];   //Total lifepoints
  255.  
  256.     char weapon[MAXWEAPONNAME+1];            //Weapon name
  257.     char weapon_energy[MAXSTANDARDLONG+1];   //Current amount of Energy Packs
  258.     char weapon_strength[MAXSTANDARDINT+1];  //Weapon strength i.e. 1, 2, 3, 4 etc.
  259.     char max_packs[MAXSTANDARDLONG+1];   //Total energy packs gun will hold
  260.  
  261.     char weapon_status[MAXSTANDARDINT+1];  //if owns weapon = 1
  262.     char weapon_cost[MAXSTANDARDLONG+1];   //Weapon's value
  263.  
  264.     char armor[MAXARMORNAME+1];           //Armor Name
  265.     char armor_strength[MAXSTANDARDLONG+1];   //Strength of Armor
  266.     char armor_status[MAXSTANDARDINT+1];    //if they have armor = 1
  267.     char armor_cost[MAXSTANDARDLONG+1];     //Armor Value
  268.  
  269.     char credits[MAXSTANDARDLONG+1];       //credits on hand
  270.     char bank_credit[MAXSTANDARDLONG+1];   //credits in Guido's Bank
  271.  
  272.     char pod[MAXSTANDARDINT+1];       //if own a pod = 1
  273.  
  274.     //SOMEBODY CRUISE THIS SHIP ALL OVER THE GALAXY PLEASE!!! <G>
  275.     //Battles!  Trading, quests, exploration, planets, stars...
  276.  
  277.     char ship[MAXSTANDARDINT+1];     //if own a ship = 1                     //               2=I'stellar cruiser
  278.     char ship_name[MAXNAME+1];          //name of ship
  279.     char ship_type[MAXSTANDARDINT+1];    //type of ship.  1=garbage scow
  280.                      //                   2=I'stellar cruiser
  281.  
  282.     char mt[MAXSTANDARDINT+1];            //has a matter transmitter =1
  283.     char arkon_bomb[MAXSTANDARDINT+1];    //has a bomb = 1
  284.  
  285.     char level[MAXSTANDARDINT+1];         //player level
  286.     char experience[MAXSTANDARDLONG+1];   //Experience
  287.     char kills[MAXSTANDARDINT+1];         //kills.  <-used on asteroid. Turns used.
  288.     char droids[MAXSTANDARDINT+1];        //number of droids
  289.     char passkey[MAXSTANDARDINT+1];       //number of passkeys
  290.  
  291.      //globals
  292.     char on_off[MAXSTANDARDINT+1];        //if droids armed = 1
  293.     char sickbay_closed[MAXSTANDARDINT+1];   //if sickbay closed = 1
  294.     char bank_closed[MAXSTANDARDINT+1];     //if bank_closed = 1
  295.     char pickpocket[MAXSTANDARDINT+1];     //pickpocketed nurse wetley
  296.     char tipcnt[MAXSTANDARDINT+1];  //how many times stolen tips
  297.     char owns[MAXSTANDARDINT+1];    //owns weaponshop = 1
  298.                     //owns armorshop = 2
  299.                     //owns both = 3
  300.     char fights[MAXSTANDARDINT+1];        //fights used today
  301.     char last_played[MAXSTANDARDINT+1];   //day last played. (stardate)
  302.     };
  303.  
  304.  
  305. That big mess is converted to this in the game:
  306.  
  307.  
  308. struct on_line_player
  309.     {
  310.     int on_now;
  311.     char name[MAXNAME+1];
  312.     char bbs_name[MAXBBSNAME+1];
  313.     int living;
  314.     char killer[MAXNAME+1];
  315.     int location;
  316.     long lifepoints;
  317.     long lifepointsttl;
  318.  
  319.     char weapon[MAXWEAPONNAME+1];
  320.     unsigned long weapon_energy;
  321.     int weapon_strength;
  322.     unsigned long max_packs;
  323.     int weapon_status;
  324.     unsigned long weapon_cost;
  325.  
  326.     char armor[MAXARMORNAME+1];
  327.     unsigned long armor_strength;
  328.     int armor_status;
  329.     unsigned long armor_cost;
  330.  
  331.     unsigned long credits;
  332.     unsigned long bank_credit;
  333.  
  334.     int pod;
  335.  
  336.     int ship;
  337.     char ship_name[MAXNAME+1];
  338.     int ship_type;
  339.     int mt;
  340.     int arkon_bomb;
  341.  
  342.     int level;
  343.     unsigned long experience;
  344.     int kills;
  345.     int droids;
  346.     int passkey;
  347.     int on_off;
  348.     //reset daily by extern:   //from defaults....
  349.     int sickbay_closed;        //killed staff
  350.     int bank_closed;           //angered guido
  351.     int pickpocket;            //picked N. Wetlys pocket
  352.     int tipcnt;                //max tips taken
  353.     int owns;                 //1 owns weapon shop, 2 owns armor shop
  354.     int fights;                //fights used today
  355.     int last_played;           //stardock days running
  356.     };
  357.  
  358. --------------------------------------------------------------------------
  359. Favrie Colony player list:   fav_pl.lst
  360. --------------------------------------------------------------------------
  361. If you wish to use the special skills that the player has gotten on the
  362. colony, or any other stuff, here it is:
  363.  
  364.  
  365. Expect this to change if I expand the colony.
  366.  
  367. struct fahvrie
  368. {
  369. unsigned long cillenium;      //how much cillenium they have found
  370. int skill;                    //skill 1 = nard kick, 2 3 4 5 6 7 8 9
  371.                   //if they are a level 4, they can use 4,3,2,1
  372. int mine_turns;               //turns used in the mine
  373. int fight_turns;              //turns used in the nightclub
  374. int fights;                   //total fights in the nightclub
  375.                   //   important to raise skill level.
  376. unsigned long bank_credit;
  377. };
  378.  
  379.  
  380. As stored in the fav_pl.lst, text format:
  381.  
  382. struct p_file
  383. {
  384. char name[MAXNAME+1];                         //Real Name
  385. char cillenium[MAXSTANDARDLONG+1];            /////////////////////////
  386. char weapon[MAXWEAPONNAME+1];                 /// <<-not used yet
  387. char mine_turns[MAXSTANDARDINT+1];            ///   Same as above
  388. char complex_turns[MAXSTANDARDINT+1];         /// <<-not used yet
  389. char nightclub_turns[MAXSTANDARDINT+1];       ///
  390. char bank_credit[MAXSTANDARDLONG+1];          ///
  391. char fight_turns[MAXSTANDARDINT+1];           ///
  392. char skill[MAXSTANDARDINT+1];                 ///
  393. char fights[MAXSTANDARDINT+1];                ////////////////////////
  394. char exp2[MAXSTANDARDINT+1];       //expansion slot <-not used yet.
  395. char date;             //date last played.  date<<_dos_getdate
  396. };
  397.  
  398.  
  399. --------------------------------------------------------------------------
  400. module.lst  record definition
  401. --------------------------------------------------------------------------
  402. I've added this for those of you that wish to add an easy install for the
  403. sysop that automatically adds your module into the module.lst for the
  404. ShipYards expansion area.
  405.  
  406. Please include an easy un-install as well.
  407.  
  408. #define MAXPATH 36         // length of fields in entry box
  409. #define MAXDESCRIPTION 40
  410.  
  411. struct record
  412. {
  413. char path[MAXPATH];
  414. char description[MAXDESCRIPTION];
  415. };
  416.  
  417. ---------------------------------------------------------------------------
  418. News File:         news.fil
  419. ---------------------------------------------------------------------------
  420. Wanna dump something in the news?  Here ya go.
  421.  
  422. #define MAXNEWS 80
  423.  
  424. struct daily
  425.     {
  426.     char date[MAXSTANDARDINT+1]; //Stardate (game running date for delete)
  427.                      //game starts at 1 - see global.dat file
  428.                      //description for more details on date.
  429.     char line[MAXNEWS+1];    //80 + 1    //news goes here.
  430.     };
  431.  
  432.  
  433.  
  434. ---------------------------------------------------------------------------
  435. Mail File:         mail.fil
  436. ---------------------------------------------------------------------------
  437. #define MAXNEWS 80
  438.  
  439. struct new_mail
  440. {
  441. char from_name[MAXNAME+1];       //from
  442. char to_name[MAXNAME+1];         //to
  443. char line[MAXNEWS+1];            //what they said.
  444. };
  445.  
  446. --------------------------------------------------------------------------
  447. Global.dat file  (Created by the install program sd_init.exe)
  448.          (Stardate updated by first player on new day
  449.           by spawned sd_ext.exe - maintenance program)
  450. --------------------------------------------------------------------------
  451. struct global_file
  452. {
  453. char lifepoints[MAXSTANDARDLONG+1];      //new player lifepoints
  454. char lifepointsttl[MAXSTANDARDLONG+1];   //new player total lifepoints
  455. char credits[MAXSTANDARDLONG+1];         //new player credits
  456. char droids[MAXSTANDARDINT+1];           //new player droids
  457. char tipcnt[MAXSTANDARDINT+1];           //maximum stolen tips a day (turns)
  458. char wep_owner[MAXNAME+1];               //who currently owns weaponshop
  459. char arm_owner[MAXNAME+1];               //who currently owns armorshop
  460. char fights[MAXSTANDARDINT+1];           //fights per day
  461. char stardate[MAXSTANDARDINT+1];         //current stardate running
  462.     //^use this if you create news!     //  this starts at one, and is
  463.                      //  updated during each maintenance
  464.                      //  run.  Incremented by 1.
  465. unsigned char realdate;                  //Real d.day from _dos_getdate
  466. };                                       //I just check for a change.
  467.  
  468.  
  469. --------------------------------------------------------------------------
  470. Exclusive File Access
  471. --------------------------------------------------------------------------
  472. This is the exclusive file access routine used for the program:
  473.  
  474. For those that haven't used exclusive file access:  What this does is
  475. keeps two players from writing or reading a file at the same time.  Big
  476. problems could develop on multi-line BBS's if players are playing
  477. at the same time, and writing the same file at the same moment.  Bad Bad
  478. Bad!!!  <G>
  479.  
  480. Author of the following exclusive file access function:
  481.      Brian Pirie, Opendoors Door Programming Toolkit. <-get it, it's good!
  482.  
  483.  
  484. #define WAIT_FOR_FILE         10       /* Time to wait for access to file */
  485. FILE *OpenExclusiveFile(char *pszFileName, char *pszAccess, time_t Wait);
  486.  
  487.  
  488. FILE *OpenExclusiveFile(char *pszFileName, char *pszAccess, time_t Wait)
  489. {
  490.    FILE *pfFile;
  491.    time_t StartTime = time(NULL);
  492.  
  493.    for(;;)
  494.    {
  495.       /* Attempt to open file */
  496.       pfFile = fopen(pszFileName, pszAccess);
  497.  
  498.       /* If file was opened successfuly, then exit */
  499.       if(pfFile != NULL) break;
  500.  
  501.       /* If open failed, but not due to access failure, then exit */
  502.       if(errno != EACCES) break;
  503.  
  504.       /* If maximum time has elapsed, then exit */
  505.       if(StartTime + Wait < time(NULL)) break;
  506.  
  507.       /* Give the OpenDoors kernel a chance to execute before trying again */
  508.  
  509.           /////////NOTE///////////////////
  510.       od_kernel();  //should be included if you use Opendoors 5.0
  511.    }                //or exclude it if you don't.
  512.  
  513.    /* Return pointer to file, if opened */
  514.    return(pfFile);
  515. }
  516.  
  517. ---------------------------------------------------------------------------
  518. Enemies are hard coded in the game....ewwww.
  519. ---------------------------------------------------------------------------
  520.  
  521. struct enemy
  522.     {
  523.     char name[MAXNAME+1];    //name of alien
  524.     int living;       //if alive = 1
  525.     char weapon[MAXWEAPONNAME+1];    //weapon name
  526.     unsigned long weapon_energy;     //weapon enemy
  527.     int weapon_strength;            //weapon strength
  528.     int level;                      //level <-not used
  529.     unsigned long experience;       //experience
  530.     int kills;                      //kills <-not used
  531.     int weapon_status;     //if they have a weapon = 1  <-not used
  532.     char armor[MAXARMORNAME+1];       //armor name
  533.     unsigned long armor_strength;     //armor strength
  534.     unsigned long credits;           //credits
  535.     long lifepoints;                 //yep
  536.     long lifepointsttl;              //uh-huh
  537.     };
  538.  
  539.  
  540. Well, there it all is.  If you want some more info, write me e-mail at
  541. alanen@hvs.mail.com (Rock Garden BBS, Phoenix AZ) or at the Sherwood Forest
  542. BBS, (602) 876-0013.
  543. I'd be glad to look at what you have, or try to answer any pertinent questions.
  544.  
  545.  
  546. Hasta luego amigos.  Estamos locos....(pardon my bad spanish)  I'm a finlander
  547. that should be herding raindeer, not babbling in spanish and drinking irish
  548. cervezas...<G>
  549.  
  550. ----------------------------------------------------------------------------
  551. More Help for Opendoors Hombres...
  552. ----------------------------------------------------------------------------
  553. This is the main routine for the favrie colony. Also follows is a
  554. player file read for any module or main file.  See also MODULE.C.
  555.  
  556. void main(int argc,char *_argv[])
  557. {
  558. int counter;
  559. int sync=0;
  560.  
  561. for(counter=1;counter<argc;++counter)
  562.  
  563.     {
  564.     if((_argv[counter])[1]=='l'||(_argv[counter])[1]=='L')
  565.         {
  566.         od_control.od_force_local=TRUE;   //make it local mode.
  567.         od_clr_scr();
  568.         od_printf("`cyan`╒═════════════════════════════════════════════════════════════╕\n\r");
  569.         od_printf("│`green`STARDOCK LOCO -`cyan` Local Mode  - Favrie Colony                  │\n\r");
  570.         od_printf("╘═════════════════════════════════════════════════════════════╛\n\r");
  571.         od_printf(" Enter your name: ");
  572.         od_input_str(door_sys_name,MAXBBSNAME,32,127);
  573.         door();
  574.         sync=1; //keep from playing game twice.
  575.         }
  576.       }
  577. if(sync==0)         //otherwise we play game twice in local mode...
  578. {                   //hey, I'm new at this...<G>
  579. if(argc>1) strncpy(od_control.info_path,_argv[1],59);  //path to door file
  580. od_init();                                     //opendoors initialization.
  581. strcpy(door_sys_name,od_control.user_name);   //move user_name from door.sys
  582. door();                                       //to my door_sys_name.
  583. }
  584. }
  585.  
  586. #define    MAXBBSNAME 36
  587. char door_sys_name[MAXBBSNAME+1];
  588.  
  589.  
  590. void door(void)
  591. {
  592. char answer;
  593. r_player_file();           //get the player's normal stats.
  594. if(playerfound==1)
  595. {
  596. r_fahvrie_file();          //get the player's favrie stats.
  597. od_clr_scr();              //clear screen.
  598. od_printf("\n\r╒═════════════════════════════════════════════════════════════╕\n\r");
  599. od_printf("│`green`STARDOCK LOCO -`cyan` Rental Craft                                 │\n\r");
  600. od_printf("╘═════════════════════════════════════════════════════════════╛\n\r");
  601. od_printf("You get into the little short range Needler that you rented\n\r");
  602. od_printf("from Guido and head over to the Favrie Colony. \n\r");
  603. od_printf("\n\r             <`red`L`cyan`> Land at the Favrie Colony\n\r");
  604. od_printf("             <`red`X`cyan`> Exit back to Stardock\n\r");
  605. od_printf("\n\rMake your choice:  ");
  606. answer=od_get_answer("LX\n\r");
  607. switch(answer)
  608.     {
  609.     case 'X':
  610.         od_printf("\n\rScared of Deep Space, you decide to return to the Stardock.");
  611.         WaitForEnter();
  612.         break;
  613.     case 'L':
  614.     default:
  615.         favrie_main();    //main favrie screen and options menu.
  616.         break;
  617.     }
  618. }
  619. else
  620.     {
  621.     od_printf("\n\rPlayer not found!");
  622.     od_printf("Name Error.");
  623.     WaitForEnter();
  624.     }           //then will return from whence it came...
  625. }
  626.  
  627.  
  628. ////////////////////read of player file to get details///////////////
  629.  
  630. void r_player_file(void)
  631. {
  632. struct player *names;
  633. int p;
  634. FILE *fptr;
  635. record_count=0;
  636. if((names=(struct player*) calloc(100,sizeof(struct player)))==NULL)
  637.     {
  638.     od_printf("\n\rNot enough memory for Player.lst");
  639.     WaitForEnter();
  640.     }
  641. else
  642. {              ///must have the exclusive file access....
  643.     fptr = OpenExclusiveFile("player.lst", "rb", WAIT_FOR_FILE);
  644.     while( fread(&names[record_count],sizeof(names[record_count]),1,fptr)==1)
  645.         record_count++;
  646.     fclose(fptr);
  647.        }
  648.  
  649.                //check for a match of name[p].bbs_name
  650.               //against door_sys_name
  651. for(p=0;p<record_count;p++)
  652.     { //begin for
  653.     if (stricmp (door_sys_name,names[p].bbs_name) ==0 )
  654.         {  //begin if
  655.         playerfound=1;     //player is found...
  656.         strcpy(current.name,names[p].name);
  657.         strcpy(current.bbs_name,names[p].bbs_name);
  658.         current.living=atoi(names[p].living);
  659.         strcpy(current.killer,names[p].killer);
  660.         current.location=atoi(names[p].location);
  661.         current.lifepoints=atol(names[p].lifepoints);
  662.         current.lifepointsttl=atol(names[p].lifepointsttl);
  663.         /////////AAAAAAAAAAAAAAAAAAAAAAAAAGGGGGGGGGGGGGHHHHHH
  664.         strcpy(current.weapon,names[p].weapon);
  665.         current.weapon_energy=atol(names[p].weapon_energy);
  666.         current.weapon_strength=atoi(names[p].weapon_strength);
  667.         current.max_packs=atol(names[p].max_packs);
  668.         /////////////lalalalalallaalalalalalalalal
  669.         current.weapon_status=atoi(names[p].weapon_status);
  670.         current.weapon_cost=atol(names[p].weapon_cost);
  671.  
  672.         strcpy(current.armor,names[p].armor);
  673.         current.armor_strength=atol(names[p].armor_strength);
  674.         current.armor_status=atoi(names[p].armor_status);
  675.         current.armor_cost=atol(names[p].armor_cost);
  676.  
  677.         current.credits=atol(names[p].credits);
  678.         current.bank_credit=atol(names[p].bank_credit);
  679.  
  680.         current.pod=atoi(names[p].pod);
  681.       ///AND THERE IS YET MORE!!!!!!!!!!!!!
  682.         current.ship=atoi(names[p].ship);
  683.         strcpy(current.ship_name,names[p].ship_name);
  684.         current.ship_type=atoi(names[p].ship_type);
  685.         current.mt=atoi(names[p].mt);
  686.         current.arkon_bomb=atoi(names[p].arkon_bomb);
  687.      ///Talk about a pain in the butt.
  688.         current.level=atoi(names[p].level);
  689.         current.kills=atoi(names[p].kills);
  690.         current.experience=atol(names[p].experience);
  691.         current.droids=atoi(names[p].droids);
  692.         current.passkey=atoi(names[p].passkey);
  693.      ///I shan't do it like this again......
  694.         current.on_off=atoi(names[p].on_off);
  695.         current.sickbay_closed=atoi(names[p].sickbay_closed);
  696.         current.bank_closed=atoi(names[p].bank_closed);
  697.         current.pickpocket=atoi(names[p].pickpocket);
  698.         current.tipcnt=atoi(names[p].tipcnt);
  699.         current.owns=atoi(names[p].owns);
  700.         current.fights=atoi(names[p].fights);
  701.         current.last_played=atoi(names[p].last_played);
  702.      //////////get me outta here!!!!!!!!!!
  703.         p=record_count;
  704.         }    //end if
  705.      else playerfound=0;
  706.     }  //end for
  707. free(names);       /////Dump the calloc
  708. }
  709.  
  710. Any additional questions can be sent to me at the following addresses:
  711. ----------------------------------------------------------------------------
  712. The support BBS for new versions of Stardock Loco is the Sherwood Forest BBS.
  713. This BBS is run by a friend of mine, John Myers, aka Little_john.
  714.  
  715. The number is: (602) 876-0013.
  716.  
  717. To access the file and message areas for Stardock Loco,
  718. use the following log-in:
  719.  
  720. First Name:     Stardock
  721. Last Name :     Loco
  722. Password  :     Support
  723.  
  724. My name, if you forgot, is Aaron Alanen.  I can also be reached by i-mail/e-mail
  725. at alanen@mail.hvs.com (Rock Garden BBS, Phoenix, AZ)
  726.  
  727. Other ways to reach me:
  728.  
  729. aaron.alanen@jccs.parasol.stat.com
  730. MajorNet: notme atall@rok
  731.  
  732. I can also be reached in Phoenix, Arizona at the following BBS:
  733.  
  734.         JCCS BBS            : (602) 582-4200
  735.  
  736. (Note: I am only a member there, and not the SySop!)
  737.  
  738. Or snail:
  739.  
  740.         Aaron Alanen
  741.         6502 E. Vernon
  742.         Scottsdale, AZ 85257-1140
  743.         USA.
  744.  
  745. See the ORDER.FRM to get information on registering Stardock Loco!
  746.  
  747. Thanks for reading this far!
  748. ----------------------------------------------------------------------------